cmake_minimum_required(VERSION 3.10)

project(modbus LANGUAGES CXX)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libmodbus)

file(GLOB SOURCES
    libmodbus/*.c
    libmodbus/*.h
    modbus.cpp
    modbus.hpp
)

add_library(${PROJECT_NAME} INTERFACE)
target_sources(${PROJECT_NAME} INTERFACE ${SOURCES})
target_include_directories(${PROJECT_NAME} INTERFACE
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/libmodbus
)
